package cn.edu.seu.ssny.service.impl;

import cn.edu.seu.ssny.dao.ISysClassDao;
import cn.edu.seu.ssny.dao.support.IBaseDao;
import cn.edu.seu.ssny.entity.SysClass;
import cn.edu.seu.ssny.entity.User;
import cn.edu.seu.ssny.service.ISysClassService;
import cn.edu.seu.ssny.service.support.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("sysClassService")
public class SysClassServiceImpl extends BaseServiceImpl<SysClass, Long> implements ISysClassService {
    @Autowired
    private ISysClassDao sysClassDao;

    @Override
    public IBaseDao<SysClass, Long> getBaseDao() {
        return this.sysClassDao;
    }

    /**
     * 功能描述:
     * <根据projectId查询出该项目的所有系统分类
     *
     * @param projectId
     * @return
     */
    @Override
    public List<SysClass> findAllByProjectId(Long projectId) {
        return sysClassDao.findAllByProjectId(projectId);
    }

    /**
     * 功能描述
     * <根据sysClassId返回系统分类
     *
     * @param id
     */
    @Override
    public SysClass findById(Long id) {
        return sysClassDao.findOne(id);
    }

    /**
     * 功能描述
     * <根据项目ID和分类名查询对应的分类
     *
     * @param projectId
     * @param className
     * @return
     */
    @Override
    public SysClass findByProjectIdAndClassName(Long projectId, String className) {
        return sysClassDao.findByProjectIdAndClassName(projectId, className);
    }


}
